package com.hefu.virtuallife.base;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
 * Created by zc on 2018/5/29.
 */

public abstract class BaseActivity extends AppCompatActivity {
    Unbinder mButterKnifeBinder;
    public Context mContext;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //隐藏虚拟按键，并且全屏
        setContentView(setLayoutId());
        mButterKnifeBinder=   ButterKnife.bind(this);
        mContext = this;
        initVariables(savedInstanceState);

    }

    // 布局资源ID
    protected abstract int setLayoutId();
    // 初始化变量 子类需要就重写
    protected abstract void initVariables(@Nullable Bundle savedInstanceState);

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mButterKnifeBinder.unbind();
    }
}
